#include <Arduino.h>

#define d3 14

void service_tim0()
{
    digitalWrite(d3,!digitalRead(d3)); 
}

hw_timer_t *tim0 = NULL;//定义一个空指针
void init_timer()
{
    tim0 = timerBegin(0,80,true);
    timerAttachInterrupt(tim0,service_tim0,true);
    timerAlarmWrite(tim0,20000000,true);
    timerAlarmEnable(tim0);
}
void setup() {
  pinMode(d3,OUTPUT);
  init_timer();

}

void loop() {
  
}
 